# This module contains all the configurations value used by the program

module Configurations
    
  # set dafult options value
  def self.set_default
    $num_of_searches = 1								# number of random block to search
		$num_of_pages = 1									# gscraper num of pages to fetch
		$num_of_results_yahoo = 10 							# number of yahoo results
		$p = 1211											# costant used for Bentley McIlroy algorithm
		$bsize = 20											# size of word blocks used to build the hash table
  end
  
  # set options value 
  # glade -> GladeXML object that contains the information
  def self.set_from_glade(glade)
    $num_of_searches = (glade["searchNentry"].text).to_i
		$num_of_pages = (glade["pageNentry"].text).to_i
		$p = (glade["Pentry"].text).to_i
		$bsize = (glade["blockSizeSpin"].value).to_i
    $num_of_results_yahoo = 10
    
    if glade["googleCheckButton"].active?
			$google = true
		else
			$google = false
		end 
		if glade["yahooCheckButton"].active?
			$yahoo = true
		else
			$yahoo = false
		end # if 
    
  end
  
  def self.set_local(value)
    $local = value
  end
   
  
end
